Computers configured as virtual machines are well known today. In this configuration, a hypervisor program logically divides physical resources of a real computer into separate virtual machines. A virtual machine is a virtual sharing of computer resources such as processor(s), memory, storage and I/O (i.e. network cards, printers and displays.) A guest operating system executes/runs on each virtual machine. One or more applications and middleware programs (such as a file manager) run on each guest operating system. Even though each application, middleware program and guest operating system are executing in a virtual machine, they operate as if they are running on their own private, real computer. In a known IBM z/VM operating system, the hypervisor program is called the Control Program (“CP”), and each virtual machine may be called a “virtual machine”, a “user portion” or a “guest”. It was also known for a logical partitioning program to logically divide the physical resources of a real computer into logical partitions (“LPARs”), and then for the hypervisor to logically divide each LPAR into virtual machines. In a known IBM zSeries computer, a known IBM Processor Resource/Resource Manager (“PR/SM”) program logically partitions a real computer.
The known division of a real computer into virtual machines is further described as follows. The hypervisor allocates to each virtual machine a time share of one or more real processors. The hypervisor also allocates to each virtual machine a range of (virtual) private memory (“VPM”) mapped to RAM. When a virtual machine addresses its own (virtual) private memory, the hypervisor translates the virtual memory address into a real address of real memory. The hypervisor also allocates memory to itself to store its own control structures.
The guest operating system in each virtual machine can be the Linux (™ of Linus Torvalds) operating system, IBM CMS operating system or other operating systems. The applications that execute on each guest operating system on each virtual machine can be an IBM DB2 data base management application, IBM Websphere application, or other applications.
The guest operating system and application(s) for each virtual machine are stored in the private memory allocated to the virtual machine. Each virtual machine also includes a cache in the virtual machine's private memory. The cache contains data recently accessed from (disk) storage via a file system by the application or middleware, and associated metadata. The metadata comprises a directory and sub directory path to the file, identities of records within the file currently being written or read, size of the file, size of records in the file, type (ASCII, EBCDIC or BINARY) of data in the file, where the file is stored on disk, etc.
As explained above, it is also known for a logical partitioning program to logically divide a single real computer into multiple logical partitions (“LPARs”), and then for a hypervisor to logically divide each logical partition into separate virtual machines. In other words, the logical partitioning program logically divides and virtualizes the computer resources (including the share of processor(s) and memory) to form each LPAR, and then the hypervisor further divides the logical share of computer resources of each LPAR to form the resource platform for each of the virtual machines. Typically, an administrator assists in defining each logical partition (“LPAR”) by specifying to the logical partitioning program the amount of processors, memory and storage for each LPAR. Each LPAR could be allocated specific real computer resources or a share of the total computer resources. In some computers, a separate hypervisor was loaded into each LPAR to form multiple virtual machines in each logical partition. The virtual machines in each LPAR operate in the same manner as if they were formed directly from the real computer.
An existing IBM z/VM version 4.2.0 or 4.3.0 virtual machine operating system includes a known hypervisor program with capability to form each of the virtual machines from LPARs or real computers. The details of the existing z/VM 4.2.0 operating system are disclosed in IBM publication “z/VM 4.2.0 General Information” (Document Number: GC24-5991-03) which is available from International Business Machines Corp. at PO Box 29570, IBM Publications, Raleigh, N.C. 27626-0570 or on the WWW at www.IBM.com/shop/publications/order. This publication is hereby incorporated by reference as part of the present disclosure.
File manager programs, such as IBM DB/2 program, are also known. A file manager program may be considered “middleware”. An application in a virtual machine can make a request to a file manager for a file, and the file manager accesses the file from storage for the application. The file manager may create a cache in memory to store pages of file needed by the application, and retain those pages according to a most recently used algorithm.
Occasionally, a virtual machine terminates. The termination may be “on purpose” when requested by a user of the virtual machine or by an administrator of the real computer. This purposeful termination is typically implemented as a standard “log off”. The termination may also be accidental due to a failure of the virtual machine, guest operating system, hypervisor or real computer. When the virtual machine terminates due to a failure of the virtual machine or guest operating system or due to log off of the virtual machine, the known hypervisor automatically deletes the contents of the private memory (including the cache) of the virtual machine.
It was known for the guest operating system in each virtual machine to periodically “journal” or copying contents of its cache to nonvolatile disk. So, if the virtual machine terminates due to a failure of the virtual machine, guest operating system, hypervisor or real computer, the recently accessed data and metadata will be preserved. Consequently, when the virtual machine is restarted, the contents of the cache will be available from storage to resume processing. However, the periodic journaling/copying of data to storage is slow compared to other virtual machine operations, because of the nature of storage. This slows operation of the virtual machine.
An object of the present invention is to preserve contents of a cache of a virtual machine when the virtual machine terminates due to a failure of the virtual machine or its guest operating system.
A more specific object of the present invention is to preserve contents of a cache of a virtual machine without slowing operation of the virtual machine.